<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="com.ckeditor.CKEditorConfig"%>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">

<head>

<!-- Basic -->
<meta charset="UTF-8" />

<title>发表文章</title>

<!-- Mobile Metas -->
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<!-- Import google fonts -->
<link
	href="http://fonts.useso.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light"
	rel="stylesheet" type="text/css" />

<!-- Favicon and touch icons -->
<link rel="shortcut icon" href="<%=path%>/assets/ico/favicon.ico"
	type="image/x-icon" />
<link rel="apple-touch-icon"
	href="<%=path%>/assets/ico/apple-touch-icon.png" />
<link rel="apple-touch-icon" sizes="57x57"
	href="<%=path%>/assets/ico/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="72x72"
	href="<%=path%>/assets/ico/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="76x76"
	href="<%=path%>/assets/ico/apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="114x114"
	href="<%=path%>/assets/ico/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="120x120"
	href="<%=path%>/assets/ico/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" sizes="144x144"
	href="<%=path%>/assets/ico/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon" sizes="152x152"
	href="<%=path%>/assets/ico/apple-touch-icon-152x152.png" />

<!-- start: CSS file-->

<!-- Vendor CSS-->
<link href="<%=path%>/assets/vendor/bootstrap/css/bootstrap.min.css"
	rel="stylesheet" />
<link href="<%=path%>/assets/vendor/skycons/css/skycons.css"
	rel="stylesheet" />
<link
	href="<%=path%>/assets/vendor/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" />

<!-- Plugins CSS-->
<link href="<%=path%>/assets/plugins/bootkit/css/bootkit.css"
	rel="stylesheet" />
<link
	href="<%=path%>/assets/plugins/jquery-ui/css/jquery-ui-1.10.4.min.css"
	rel="stylesheet" />
<link
	href="<%=path%>/assets/plugins/editable/css/bootstrap-editable.css"
	rel="stylesheet" />

<!-- Theme CSS -->
<link href="<%=path%>/assets/css/jquery.mmenu.css" rel="stylesheet" />

<!-- Page CSS -->
<link href="<%=path%>/assets/css/style.css" rel="stylesheet" />
<link href="<%=path%>/assets/css/add-ons.min.css" rel="stylesheet" />
<!-- end: CSS file-->


<!-- Head Libs -->
<script src="<%=path%>/assets/plugins/modernizr/js/modernizr.js"></script>

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
			<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
			<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
		<![endif]-->

<base href="<%=basePath%>">


</head>

<body>
	<!-- Start: Content -->
	<div class="container-fluid content">
		<div class="row">

			<!-- 加载header -->
			<jsp:include page="include/header.jsp"></jsp:include>
			<!-- 加载sidebar -->
			<jsp:include page="include/sidebar.jsp"></jsp:include>

			<!-- Main Page -->
			<div class="main ">
				<!-- Page Header -->
				<div class="page-header">
					<div class="pull-left">
						<ol class="breadcrumb visible-sm visible-md visible-lg">
							<li><a href="<%=path%>/user/index?userId=${sessionScope.user.userId}"><i
									class="icon fa fa-home"></i>首页</a></li>
							<li class="active"><i class="fa fa-pencil"></i>发表文章</li>
						</ol>
					</div>
				</div>
				<!-- End Page Header -->
				<div class="row">
					<!-- <div class="col-md-6">-->
					<span style="color: green">${requestScope.createSucceed}</span>
					<span style="color: red">${requestScope.createFailed}</span>
					<div class="panel">
						<div class="panel-body">
							<form action="<%=path%>/article/createArticle" method="post"
								enctype="multipart/form-data" class="form-horizontal ">
								<div class="form-group" align="left">
									<label class="col-md-3 control-label" for="text-input">文章标题</label>
									<div class="col-md-9">
										<input type="text" id="text-input" name="articleTitle"
											class="form-control" placeholder="请输入标题...">
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-3 control-label" for="select">类型</label>
									<div class="col-md-9">
										<select id="select" name="articleType" class="form-control"
											size="1">
											<c:forEach items="${requestScope.articleTypes}" var="item">
												<option value="${item.articleType}">${item.articleType}</option>
											</c:forEach>
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-3 control-label" for="textarea-input">内容</label>
									<div class="col-md-9">
										<textarea id="textarea-input" name="articleContent" rows="15"
											class="form-control" placeholder="Content.."></textarea>

									</div>
								</div>
								<div class="col-md-12">
									<div class="pull-right">
										<button type="submit" class="btn btn-primary">发表</button>
										<button type="reset" class="btn btn-default">还原</button>
									</div>
								</div>
							</form>
							<%
								CKEditorConfig settings1 = new CKEditorConfig();
								//settings1.addConfigValue("height", "600");
								//settings1.addConfigValue("width", "800");
							%>
							<ckeditor:replace replace="textarea-input"
								basePath="${pageContext.request.contextPath}/ckeditor/"
								config="<%=settings1 %>" />
						</div>
					</div>
					<!-- </div> -->
				</div>
			</div>
		</div>
		<!-- End Main Page -->
	</div>
	<!--/container-->


	<div class="clearfix"></div>


	<!-- start: JavaScript-->

	<!-- Vendor JS-->
	<script src="<%=path%>/assets/vendor/js/jquery.min.js"></script>
	<script src="<%=path%>/assets/vendor/js/jquery-2.1.1.min.js"></script>
	<script src="<%=path%>/assets/vendor/js/jquery-migrate-1.2.1.min.js"></script>
	<script src="<%=path%>/assets/vendor/bootstrap/js/bootstrap.min.js"></script>
	<script src="<%=path%>/assets/vendor/skycons/js/skycons.js"></script>

	<!-- Plugins JS-->
	<script
		src="<%=path%>/assets/plugins/jquery-ui/js/jquery-ui-1.10.4.min.js"></script>
	<script src="<%=path%>/assets/plugins/mockjax/js/jquery.mockjax.min.js"></script>
	<script
		src="<%=path%>/assets/plugins/editable/js/bootstrap-editable.min.js"></script>
	<script src="<%=path%>/assets/plugins/moment/js/moment.min.js"></script>
	<script
		src="<%=path%>/assets/plugins/editable/inputs-ext/typeaheadjs/typeaheadjs.min.js"></script>
	<script
		src="<%=path%>/assets/plugins/editable/inputs-ext/address/address.min.js"></script>
	<script src="<%=path%>/assets/plugins/select2/js/select2.min.js"></script>

	<!-- Theme JS -->
	<script src="<%=path%>/assets/js/jquery.mmenu.min.js"></script>
	<script src="<%=path%>/assets/js/core.min.js"></script>

	<!-- Pages JS -->
	<script src="<%=path%>/assets/js/pages/form-x-editable-demo.js"></script>
	<script src="<%=path%>/assets/js/pages/form-x-editable.js"></script>
	<script src="<%=path%>/ckeditor/ckeditor.js"></script>
	<!-- end: JavaScript-->
</body>

</html>